package bento.views.pnls;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextArea;
import javax.swing.border.EtchedBorder;

import bento.IHasWrapper;
import bento.IWrapper;
import bento.views.pnls.PnlGate.Wrapper;

import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;

public class PnlGate extends JPanel implements IHasWrapper<PnlGate.Wrapper> {
    private Wrapper wrapper;
    
    
    
    @Override
    public Wrapper getWrapper() {
        return wrapper;
    }

    /**
     * Create the panel.
     */
    public PnlGate() {
        setLayout(new CardLayout(0, 0));
        
        JPanel panel_1 = new JPanel();
        add(panel_1, "name_32196302337085");
        panel_1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
        
        JPanel panel_2 = new JPanel();
        panel_1.add(panel_2);
        panel_2.setLayout(new BorderLayout(0, 0));
        
        JPanel panel = new JPanel();
        panel_2.add(panel, BorderLayout.NORTH);
        panel.setLayout(new FormLayout(new ColumnSpec[] {
                ColumnSpec.decode("right:default"),
                ColumnSpec.decode("max(125px;default):grow"),},
            new RowSpec[] {
                RowSpec.decode("default:grow"),
                RowSpec.decode("default:grow"),}));
        
        JLabel lblNewLabel = new JLabel("User Name: ");
        panel.add(lblNewLabel, "1, 1");
        
        JTextArea textArea = new JTextArea();
        textArea.getDocument().putProperty("filterNewlines", Boolean.TRUE);
        textArea.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
        panel.add(textArea, "2, 1, fill, fill");
        
        JLabel lblNewLabel_1 = new JLabel("Password: ");
        panel.add(lblNewLabel_1, "1, 2");
        
        JPasswordField textPane_1 = new JPasswordField();
        textPane_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
        panel.add(textPane_1, "2, 2, fill, fill");
        
        JButton btnNewButton = new JButton("Login");
        btnNewButton.setAlignmentX(Component.CENTER_ALIGNMENT);
        panel_2.add(btnNewButton, BorderLayout.CENTER);

    }
    
    public class Wrapper implements IWrapper<Component> {

        public void addActionListener() {
            
        }
        
        @Override
        public Component get() {
            return PnlGate.this;
        }
        
        public Wrapper(bento.api.IBentoClient bentoClient) {
            PnlGate.this.wrapper= this;
        }
        
    }
}